#!/bin/bash

algorithm=$1
iterations_count=$2

# Poczatkowe wartosci
nodes=$3

# Obliczamy potrzebna ilosc iteracji
low_edges=$(( (3 * nodes * (nodes - 1))/20 ))
medium_edges=$(( (6 * nodes * (nodes - 1))/20 ))
high_edges=$(( (9 * nodes * (nodes - 1))/20 ))

echo "Testy dla $nodes wierzcholkow i $low_edges krawedzi... (~30%)" >> $4
echo "Testy dla $nodes wierzcholkow i $medium_edges krawedzi... (~60%)" >> $4
echo "Testy dla $nodes wierzcholkow i $high_edges krawedzi... (~90%)" >> $4

echo "Testy dla $nodes wierzcholkow i $low_edges krawedzi... (~30%)"

for i in $iterations_count; do
    `./program $algorithm $iterations_count $nodes $low_edges >> $4`
done

echo "Testy dla $nodes wierzcholkow i $medium_edges krawedzi... (~60%)"

for i in $iterations_count; do
    `./program $algorithm $iterations_count $nodes $medium_edges >> $4`
done

echo "Testy dla $nodes wierzcholkow i $high_edges krawedzi... (~90%)"

for i in $iterations_count; do
    `./program $algorithm $iterations_count $nodes $high_edges >> $4`
done

echo " "
